﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1Command;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_RptHoaDonBanHang : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("C1DockingTab1")]
        private C1DockingTab _C1DockingTab1;
        [AccessedThroughProperty("C1DockingTabPage1")]
        private C1DockingTabPage _C1DockingTabPage1;
        [AccessedThroughProperty("C1DockingTabPage2")]
        private C1DockingTabPage _C1DockingTabPage2;
        [AccessedThroughProperty("CboDonVi")]
        private ComboBox _CboDonVi;
        [AccessedThroughProperty("CboNhomTheo")]
        private ComboBox _CboNhomTheo;
        [AccessedThroughProperty("CmdCancel")]
        private Button _CmdCancel;
        [AccessedThroughProperty("CmdOK")]
        private Button _CmdOK;
        [AccessedThroughProperty("GroupBox1")]
        private GroupBox _GroupBox1;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("Label6")]
        private Label _Label6;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("Panel2")]
        private Panel _Panel2;
        [AccessedThroughProperty("Panel3")]
        private Panel _Panel3;
        [AccessedThroughProperty("RbChiTiet")]
        private RadioButton _RbChiTiet;
        [AccessedThroughProperty("RbTongHop")]
        private RadioButton _RbTongHop;
        [AccessedThroughProperty("TxtDenNgay")]
        private DateTimePicker _TxtDenNgay;
        [AccessedThroughProperty("TxtMaKH")]
        private TextBox _TxtMaKH;
        [AccessedThroughProperty("TxtMaNV")]
        private TextBox _TxtMaNV;
        [AccessedThroughProperty("TxtTenKH")]
        private TextBox _TxtTenKH;
        [AccessedThroughProperty("TxtTenNV")]
        private TextBox _TxtTenNV;
        [AccessedThroughProperty("TxtTuNgay")]
        private DateTimePicker _TxtTuNgay;
        [AccessedThroughProperty("VSList")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSList;
        [AccessedThroughProperty("VSListNV")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSListNV;
        private DataView cFrmData;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private clsDMDoiTuong objDMKH;
        private clsDMDoiTuong objDMNHANVIEN;
        private clsXuatKho objXK;
        private DataView pData;
        private string pLoaiBC;

        public Frm_RptHoaDonBanHang()
        {
            base.Load += new EventHandler(this.Frm_RptHoaDonBanHang_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.objDMKH = new clsDMDoiTuong();
            this.objXK = new clsXuatKho();
            this.objDMNHANVIEN = new clsDMDoiTuong();
            this.pLoaiBC = "";
            this.InitializeComponent();
        }

        private void CmdCancel_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdOK_Click(object sender, EventArgs e)
        {
            if (this.RbTongHop.Checked)
            {
                this.PrintReport();
            }
            else
            {
                this.PrintReportCT();
            }
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Frm_RptHoaDonBanHang_Load(object sender, EventArgs e)
        {
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                BuildComboModule.BuildCombo(this.CboDonVi, modGeneral.ListDanhMuc.DonVi, true, "", "");
                this.CboDonVi.SelectedValue = modGeneral.H_CLIENT;
                this.LoadData();
                this.LoadDataNV();
                this.CboNhomTheo.Items.Clear();
                this.CboNhomTheo.Items.Add(modGeneral.Tranlated("", ""));
                this.CboNhomTheo.Items.Add(modGeneral.Tranlated("Nh\x00e2n vi\x00ean b\x00e1n h\x00e0ng", ""));
                this.CboNhomTheo.Items.Add(modGeneral.Tranlated("Kh\x00e1ch h\x00e0ng", ""));
                this.TxtTuNgay.Text = "01/" + LVYModule.sRight("00" + Conversions.ToString(DateAndTime.Month(DateAndTime.Today)), 2) + "/" + Conversions.ToString(DateAndTime.Year(DateAndTime.Today));
                this.TxtDenNgay.Text = Strings.Format(DateAndTime.Today, "dd/MM/yyyy");
            }
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_RptHoaDonBanHang));
            this.GroupBox1 = new GroupBox();
            this.CboDonVi = new ComboBox();
            this.Label2 = new Label();
            this.RbTongHop = new RadioButton();
            this.RbChiTiet = new RadioButton();
            this.CboNhomTheo = new ComboBox();
            this.Label1 = new Label();
            this.TxtDenNgay = new DateTimePicker();
            this.TxtTuNgay = new DateTimePicker();
            this.Label3 = new Label();
            this.Label13 = new Label();
            this.CmdCancel = new Button();
            this.CmdOK = new Button();
            this.Panel3 = new Panel();
            this.C1DockingTab1 = new C1DockingTab();
            this.C1DockingTabPage1 = new C1DockingTabPage();
            this.Panel1 = new Panel();
            this.Label6 = new Label();
            this.TxtTenNV = new TextBox();
            this.TxtMaNV = new TextBox();
            this.VSListNV = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.C1DockingTabPage2 = new C1DockingTabPage();
            this.Panel2 = new Panel();
            this.Label4 = new Label();
            this.TxtTenKH = new TextBox();
            this.TxtMaKH = new TextBox();
            this.VSList = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.GroupBox1.SuspendLayout();
            this.Panel3.SuspendLayout();
            ((ISupportInitialize) this.C1DockingTab1).BeginInit();
            this.C1DockingTab1.SuspendLayout();
            this.C1DockingTabPage1.SuspendLayout();
            this.Panel1.SuspendLayout();
            this.VSListNV.BeginInit();
            this.C1DockingTabPage2.SuspendLayout();
            this.Panel2.SuspendLayout();
            this.VSList.BeginInit();
            this.SuspendLayout();
            this.GroupBox1.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            this.GroupBox1.Controls.Add(this.CboDonVi);
            this.GroupBox1.Controls.Add(this.Label2);
            this.GroupBox1.Controls.Add(this.RbTongHop);
            this.GroupBox1.Controls.Add(this.RbChiTiet);
            this.GroupBox1.Controls.Add(this.CboNhomTheo);
            this.GroupBox1.Controls.Add(this.Label1);
            this.GroupBox1.Controls.Add(this.TxtDenNgay);
            this.GroupBox1.Controls.Add(this.TxtTuNgay);
            this.GroupBox1.Controls.Add(this.Label3);
            this.GroupBox1.Controls.Add(this.Label13);
            this.GroupBox1.Dock = DockStyle.Top;
            Point point = new Point(0, 0);
            this.GroupBox1.Location = point;
            this.GroupBox1.Name = "GroupBox1";
            Size size = new Size(0x1e1, 0x6d);
            this.GroupBox1.Size = size;
            this.GroupBox1.TabIndex = 0;
            this.GroupBox1.TabStop = false;
            this.GroupBox1.Text = "T\x00f9y chọn";
            this.CboDonVi.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboDonVi.FormattingEnabled = true;
            point = new Point(0x5f, 0x11);
            this.CboDonVi.Location = point;
            this.CboDonVi.Name = "CboDonVi";
            size = new Size(290, 0x15);
            this.CboDonVi.Size = size;
            this.CboDonVi.TabIndex = 60;
            this.Label2.AutoSize = true;
            this.Label2.BackColor = Color.Transparent;
            point = new Point(13, 20);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x26, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x3b;
            this.Label2.Text = "Đơn vị";
            this.RbTongHop.AutoSize = true;
            this.RbTongHop.BackColor = Color.Transparent;
            this.RbTongHop.Checked = true;
            point = new Point(0xce, 0x57);
            this.RbTongHop.Location = point;
            this.RbTongHop.Name = "RbTongHop";
            size = new Size(0x4f, 0x11);
            this.RbTongHop.Size = size;
            this.RbTongHop.TabIndex = 2;
            this.RbTongHop.TabStop = true;
            this.RbTongHop.Text = "In tổng hợp";
            this.RbTongHop.UseVisualStyleBackColor = false;
            this.RbChiTiet.AutoSize = true;
            this.RbChiTiet.BackColor = Color.Transparent;
            point = new Point(0x5f, 0x57);
            this.RbChiTiet.Location = point;
            this.RbChiTiet.Name = "RbChiTiet";
            size = new Size(0x44, 0x11);
            this.RbChiTiet.Size = size;
            this.RbChiTiet.TabIndex = 1;
            this.RbChiTiet.Text = "In chi tiết";
            this.RbChiTiet.UseVisualStyleBackColor = false;
            this.CboNhomTheo.FormattingEnabled = true;
            point = new Point(0x5f, 0x40);
            this.CboNhomTheo.Location = point;
            this.CboNhomTheo.Name = "CboNhomTheo";
            size = new Size(290, 0x15);
            this.CboNhomTheo.Size = size;
            this.CboNhomTheo.TabIndex = 0x39;
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            point = new Point(13, 0x43);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x3b, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x38;
            this.Label1.Text = "Nh\x00f3m theo";
            this.TxtDenNgay.Format = DateTimePickerFormat.Short;
            point = new Point(0x126, 0x29);
            this.TxtDenNgay.Location = point;
            this.TxtDenNgay.Name = "TxtDenNgay";
            size = new Size(0x5b, 20);
            this.TxtDenNgay.Size = size;
            this.TxtDenNgay.TabIndex = 0x35;
            this.TxtTuNgay.Format = DateTimePickerFormat.Short;
            point = new Point(0x5f, 0x29);
            this.TxtTuNgay.Location = point;
            this.TxtTuNgay.Name = "TxtTuNgay";
            size = new Size(0x56, 20);
            this.TxtTuNgay.Size = size;
            this.TxtTuNgay.TabIndex = 0x34;
            DateTime time = new DateTime(0x7d7, 11, 1, 0, 0, 0, 0);
            this.TxtTuNgay.Value = time;
            this.Label3.AutoSize = true;
            point = new Point(0xcb, 0x2c);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(0x35, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0x37;
            this.Label3.Text = "Đến ng\x00e0y";
            this.Label13.AutoSize = true;
            this.Label13.BackColor = Color.Transparent;
            point = new Point(12, 0x2c);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x2e, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 0x36;
            this.Label13.Text = "Từ ng\x00e0y";
            this.CmdCancel.DialogResult = DialogResult.Cancel;
            this.CmdCancel.Image = (Image) manager.GetObject("CmdCancel.Image");
            this.CmdCancel.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x188, 6);
            this.CmdCancel.Location = point;
            this.CmdCancel.Name = "CmdCancel";
            size = new Size(0x52, 0x18);
            this.CmdCancel.Size = size;
            this.CmdCancel.TabIndex = 0x3d;
            this.CmdCancel.Text = "&Tho\x00e1t";
            this.CmdCancel.UseVisualStyleBackColor = true;
            this.CmdOK.Image = (Image) manager.GetObject("CmdOK.Image");
            this.CmdOK.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x134, 6);
            this.CmdOK.Location = point;
            this.CmdOK.Name = "CmdOK";
            size = new Size(0x51, 0x18);
            this.CmdOK.Size = size;
            this.CmdOK.TabIndex = 60;
            this.CmdOK.Text = "&Chọn";
            this.CmdOK.UseVisualStyleBackColor = true;
            this.Panel3.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            this.Panel3.Controls.Add(this.CmdOK);
            this.Panel3.Controls.Add(this.CmdCancel);
            this.Panel3.Dock = DockStyle.Bottom;
            point = new Point(0, 0x1d1);
            this.Panel3.Location = point;
            this.Panel3.Name = "Panel3";
            size = new Size(0x1e1, 0x22);
            this.Panel3.Size = size;
            this.Panel3.TabIndex = 0x3e;
            this.C1DockingTab1.Controls.Add(this.C1DockingTabPage1);
            this.C1DockingTab1.Controls.Add(this.C1DockingTabPage2);
            point = new Point(0, 0x73);
            this.C1DockingTab1.Location = point;
            this.C1DockingTab1.Name = "C1DockingTab1";
            size = new Size(0x1e1, 0x158);
            this.C1DockingTab1.Size = size;
            this.C1DockingTab1.TabIndex = 0x3f;
            this.C1DockingTab1.TabsSpacing = 5;
            this.C1DockingTab1.TabStyle = TabStyleEnum.Office2007;
            this.C1DockingTab1.VisualStyle = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTab1.VisualStyleBase = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTabPage1.Controls.Add(this.Panel1);
            this.C1DockingTabPage1.Controls.Add(this.VSListNV);
            this.C1DockingTabPage1.Image = ACCOUNTING.My.Resources.Resources.Selected;
            point = new Point(1, 0x19);
            this.C1DockingTabPage1.Location = point;
            this.C1DockingTabPage1.Name = "C1DockingTabPage1";
            size = new Size(0x1df, 0x13e);
            this.C1DockingTabPage1.Size = size;
            this.C1DockingTabPage1.TabIndex = 0;
            this.C1DockingTabPage1.Text = "Nh\x00e2n vi\x00ean b\x00e1n h\x00e0ng";
            this.Panel1.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            this.Panel1.Controls.Add(this.Label6);
            this.Panel1.Controls.Add(this.TxtTenNV);
            this.Panel1.Controls.Add(this.TxtMaNV);
            this.Panel1.Dock = DockStyle.Bottom;
            point = new Point(0, 0x125);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            size = new Size(0x1df, 0x19);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0x3b;
            this.Label6.AutoSize = true;
            this.Label6.BackColor = Color.Transparent;
            point = new Point(1, 6);
            this.Label6.Location = point;
            this.Label6.Name = "Label6";
            size = new Size(0x18, 13);
            this.Label6.Size = size;
            this.Label6.TabIndex = 0x12;
            this.Label6.Text = "T\x00ecm";
            point = new Point(0x91, 3);
            this.TxtTenNV.Location = point;
            this.TxtTenNV.Name = "TxtTenNV";
            size = new Size(0x128, 20);
            this.TxtTenNV.Size = size;
            this.TxtTenNV.TabIndex = 1;
            point = new Point(0x1c, 3);
            this.TxtMaNV.Location = point;
            this.TxtMaNV.Name = "TxtMaNV";
            size = new Size(0x74, 20);
            this.TxtMaNV.Size = size;
            this.TxtMaNV.TabIndex = 0;
            this.VSListNV.AutoResize = false;
            this.VSListNV.BackColor = Color.WhiteSmoke;
            this.VSListNV.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSListNV.ColumnInfo = "4,0,0,0,0,85,Columns:0{Caption:\"Kh\x00f3a\";Visible:False;}\t1{Width:20;Style:\"DataType:System.Boolean;ImageAlign:CenterCenter;\";}\t2{Width:100;Caption:\"M\x00e3 nh\x00e2n vi\x00ean\";}\t3{Width:135;Caption:\"T\x00ean nh\x00e2n vi\x00ean\";}\t";
            this.VSListNV.Cursor = Cursors.Default;
            this.VSListNV.Dock = DockStyle.Fill;
            this.VSListNV.ExtendLastCol = true;
            this.VSListNV.FocusRect = FocusRectEnum.None;
            point = new Point(0, 0);
            this.VSListNV.Location = point;
            this.VSListNV.Name = "VSListNV";
            this.VSListNV.Rows.Count = 1;
            this.VSListNV.Rows.DefaultSize = 0x11;
            this.VSListNV.SelectionMode = SelectionModeEnum.Row;
            size = new Size(0x1df, 0x13e);
            this.VSListNV.Size = size;
            this.VSListNV.StyleInfo = manager.GetString("VSListNV.StyleInfo");
            this.VSListNV.TabIndex = 0x3a;
            this.C1DockingTabPage2.Controls.Add(this.Panel2);
            this.C1DockingTabPage2.Controls.Add(this.VSList);
            this.C1DockingTabPage2.Image = ACCOUNTING.My.Resources.Resources.Selected;
            point = new Point(1, 0x19);
            this.C1DockingTabPage2.Location = point;
            this.C1DockingTabPage2.Name = "C1DockingTabPage2";
            size = new Size(0x1df, 0x13e);
            this.C1DockingTabPage2.Size = size;
            this.C1DockingTabPage2.TabIndex = 1;
            this.C1DockingTabPage2.Text = "Kh\x00e1ch h\x00e0ng";
            this.Panel2.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            this.Panel2.Controls.Add(this.Label4);
            this.Panel2.Controls.Add(this.TxtTenKH);
            this.Panel2.Controls.Add(this.TxtMaKH);
            this.Panel2.Dock = DockStyle.Bottom;
            point = new Point(0, 0x126);
            this.Panel2.Location = point;
            this.Panel2.Name = "Panel2";
            size = new Size(0x1df, 0x18);
            this.Panel2.Size = size;
            this.Panel2.TabIndex = 0x3b;
            this.Label4.AutoSize = true;
            this.Label4.BackColor = Color.Transparent;
            point = new Point(3, 6);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            size = new Size(0x18, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 0x12;
            this.Label4.Text = "T\x00ecm";
            point = new Point(0x93, 2);
            this.TxtTenKH.Location = point;
            this.TxtTenKH.Name = "TxtTenKH";
            size = new Size(0x125, 20);
            this.TxtTenKH.Size = size;
            this.TxtTenKH.TabIndex = 1;
            point = new Point(0x1c, 2);
            this.TxtMaKH.Location = point;
            this.TxtMaKH.Name = "TxtMaKH";
            size = new Size(0x74, 20);
            this.TxtMaKH.Size = size;
            this.TxtMaKH.TabIndex = 0;
            this.VSList.AutoResize = false;
            this.VSList.BackColor = Color.WhiteSmoke;
            this.VSList.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSList.ColumnInfo = manager.GetString("VSList.ColumnInfo");
            this.VSList.Cursor = Cursors.Default;
            this.VSList.Dock = DockStyle.Fill;
            this.VSList.ExtendLastCol = true;
            this.VSList.FocusRect = FocusRectEnum.None;
            point = new Point(0, 0);
            this.VSList.Location = point;
            this.VSList.Name = "VSList";
            this.VSList.Rows.Count = 1;
            this.VSList.Rows.DefaultSize = 0x11;
            this.VSList.SelectionMode = SelectionModeEnum.Row;
            size = new Size(0x1df, 0x13e);
            this.VSList.Size = size;
            this.VSList.StyleInfo = manager.GetString("VSList.StyleInfo");
            this.VSList.TabIndex = 0x34;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            this.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            size = new Size(0x1e1, 0x1f3);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.C1DockingTab1);
            this.Controls.Add(this.GroupBox1);
            this.Controls.Add(this.Panel3);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.Name = "Frm_RptHoaDonBanHang";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BC-BH01             ";
            this.Text = "BANG KE HOA DON BAN HANG";
            this.GroupBox1.ResumeLayout(false);
            this.GroupBox1.PerformLayout();
            this.Panel3.ResumeLayout(false);
            ((ISupportInitialize) this.C1DockingTab1).EndInit();
            this.C1DockingTab1.ResumeLayout(false);
            this.C1DockingTabPage1.ResumeLayout(false);
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            this.VSListNV.EndInit();
            this.C1DockingTabPage2.ResumeLayout(false);
            this.Panel2.ResumeLayout(false);
            this.Panel2.PerformLayout();
            this.VSList.EndInit();
            this.ResumeLayout(false);
        }

        public void LoadData()
        {
            this.cFrmData = new DataView(this.objDMKH.ShowListByField("Khoa|0 as Chon|Ma|Ten" + modGeneral.H_LANGUAGE, " Loai = 'C'", ""));
            if (this.cFrmData != null)
            {
                this.VSList.DataSource = this.cFrmData;
                C1.Win.C1FlexGrid.C1FlexGrid vSList = this.VSList;
                vSList[0, 1] = "";
                vSList[0, 2] = modGeneral.Tranlated("M\x00e3 kh\x00e1ch h\x00e0ng", "");
                vSList[0, 3] = modGeneral.Tranlated("T\x00ean kh\x00e1ch h\x00e0ng", "");
                vSList.Cols[0].Visible = false;
                vSList.Cols[1].DataType = System.Type.GetType("System.Boolean");
                vSList.Cols[1].Width = 20;
                vSList.Cols[2].Width = 100;
                vSList = null;
            }
        }

        public void LoadDataNV()
        {
            string str2;
            string strConditions = " CHARINDEX('E', Loai) <> 0 ";
            if (modGeneral.H_GIOIHANDULIEU)
            {
                strConditions = strConditions + " AND Khoa = '" + modGeneral.H_USERID + "'";
                str2 = "Khoa|1 as Chon|Ma|Ten";
            }
            else
            {
                str2 = "Khoa|0 as Chon|Ma|Ten";
            }
            this.pData = new DataView(this.objDMNHANVIEN.ShowListByField(str2 + modGeneral.H_LANGUAGE, strConditions, ""));
            if (this.pData != null)
            {
                this.VSListNV.DataSource = this.pData;
                C1.Win.C1FlexGrid.C1FlexGrid vSListNV = this.VSListNV;
                vSListNV[0, 1] = "";
                vSListNV[0, 2] = modGeneral.Tranlated("M\x00e3 nh\x00e2n vi\x00ean", "");
                vSListNV[0, 3] = modGeneral.Tranlated("T\x00ean nh\x00e2n vi\x00ean", "");
                vSListNV.Cols[0].Visible = false;
                vSListNV.Cols[1].DataType = System.Type.GetType("System.Boolean");
                vSListNV.Cols[1].Width = 20;
                vSListNV.Cols[2].Width = 100;
                vSListNV = null;
            }
        }

        public void PrintReport()
        {
            this.Cursor = Cursors.WaitCursor;
            object obj2 = modGeneral.CreatKey("BC_DuLieuDanhMuc", 10, "");
            ReportModule.InitDuLieuDanhMuc(Conversions.ToString(obj2), this.VSList, 0, 1, "C");
            ReportModule.InitDuLieuDanhMuc(Conversions.ToString(obj2), this.VSListNV, 0, 1, "E");
            DataTable dataTable = this.objXK.GetDataPrintHoaDon(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboDonVi.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), LVYModule.Date2Char(this.TxtTuNgay.Text), LVYModule.Date2Char(this.TxtDenNgay.Text), Conversions.ToString(obj2), "TH");
            if (dataTable.Rows.Count == 0)
            {
                this.Cursor = Cursors.Default;
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                Rpt_BangKeHoaDonBanHang hang = new Rpt_BangKeHoaDonBanHang();
                try
                {
                    hang.SetDataSource(dataTable);
                    hang.Subreports[0].SetDataSource(modGeneral.H_DATACOMPANY);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        hang.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        hang.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    hang.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESSVIET);
                    hang.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    hang.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    hang.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    hang.SetParameterValue(5, modGeneral.Tranlated("BẢNG K\x00ca H\x00d3A ĐƠN B\x00c1N H\x00c0NG", ""));
                    hang.SetParameterValue(6, modGeneral.Tranlated("Từ ng\x00e0y", "") + " : " + this.TxtTuNgay.Text);
                    hang.SetParameterValue(7, modGeneral.Tranlated("Đến ng\x00e0y", "") + " : " + this.TxtDenNgay.Text);
                    hang.SetParameterValue(8, modGeneral.Tranlated("Số chứng từ", ""));
                    hang.SetParameterValue(9, modGeneral.Tranlated("Ng\x00e0y", ""));
                    hang.SetParameterValue(10, modGeneral.Tranlated("Kh\x00e1ch h\x00e0ng", ""));
                    hang.SetParameterValue(11, modGeneral.Tranlated("Tiền h\x00e0ng", ""));
                    hang.SetParameterValue(12, modGeneral.Tranlated("Chiết khấu", ""));
                    hang.SetParameterValue(13, modGeneral.Tranlated("Tiền thuế", ""));
                    hang.SetParameterValue(14, modGeneral.Tranlated("Th\x00e0nh tiền", ""));
                    hang.SetParameterValue(15, modGeneral.Tranlated("STT", ""));
                    hang.SetParameterValue(0x10, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", ""));
                    hang.SetParameterValue(0x11, modGeneral.Tranlated("Tổng", ""));
                    hang.SetParameterValue(0x12, modGeneral.Tranlated("Lập biểu", ""));
                    hang.SetParameterValue(0x13, modGeneral.Tranlated("H\x00f3a đơn", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = hang;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    this.Cursor = Cursors.Default;
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public void PrintReportCT()
        {
            object obj2 = modGeneral.CreatKey("BC_DuLieuDanhMuc", 10, "");
            ReportModule.InitDuLieuDanhMuc(Conversions.ToString(obj2), this.VSList, 0, 1, "C");
            ReportModule.InitDuLieuDanhMuc(Conversions.ToString(obj2), this.VSListNV, 0, 1, "E");
            this.Cursor = Cursors.WaitCursor;
            DataTable dataTable = this.objXK.GetDataPrintHoaDon(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboDonVi.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), LVYModule.Date2Char(this.TxtTuNgay.Text), LVYModule.Date2Char(this.TxtDenNgay.Text), Conversions.ToString(obj2), this.pLoaiBC);
            if (dataTable.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                Rpt_BangKeHoaDonBanHangCT gct = new Rpt_BangKeHoaDonBanHangCT();
                try
                {
                    gct.SetDataSource(dataTable);
                    gct.Subreports[0].SetDataSource(modGeneral.H_DATACOMPANY);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        gct.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        gct.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    gct.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESSVIET);
                    gct.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    gct.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    gct.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    gct.SetParameterValue(5, modGeneral.Tranlated("BẢNG K\x00ca H\x00d3A ĐƠN B\x00c1N H\x00c0NG", ""));
                    gct.SetParameterValue(6, modGeneral.Tranlated("Từ ng\x00e0y", "") + " : " + this.TxtTuNgay.Text);
                    gct.SetParameterValue(7, modGeneral.Tranlated("Đến ng\x00e0y", "") + " : " + this.TxtDenNgay.Text);
                    gct.SetParameterValue(8, modGeneral.Tranlated("Số chứng từ", ""));
                    gct.SetParameterValue(9, modGeneral.Tranlated("Ng\x00e0y", ""));
                    gct.SetParameterValue(10, modGeneral.Tranlated("Kh\x00e1ch h\x00e0ng", ""));
                    gct.SetParameterValue(11, modGeneral.Tranlated("Tổng :", ""));
                    gct.SetParameterValue(12, modGeneral.Tranlated("Tổng chiết khấu", ""));
                    gct.SetParameterValue(13, modGeneral.Tranlated("Tổng tiền thuế", ""));
                    gct.SetParameterValue(14, modGeneral.Tranlated("Tổng thanh to\x00e1n", ""));
                    gct.SetParameterValue(15, modGeneral.Tranlated("STT", ""));
                    gct.SetParameterValue(0x10, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", ""));
                    gct.SetParameterValue(0x11, modGeneral.Tranlated("Tổng cộng", ""));
                    gct.SetParameterValue(0x12, modGeneral.Tranlated("M\x00e3 h\x00e0ng", ""));
                    gct.SetParameterValue(0x13, modGeneral.Tranlated("T\x00ean h\x00e0ng", ""));
                    gct.SetParameterValue(20, modGeneral.Tranlated("ĐVT", ""));
                    gct.SetParameterValue(0x15, modGeneral.Tranlated("SL", ""));
                    gct.SetParameterValue(0x16, modGeneral.Tranlated("Th\x00e0nh tiền", ""));
                    gct.SetParameterValue(0x17, modGeneral.Tranlated("Tiền thuế", ""));
                    gct.SetParameterValue(0x18, modGeneral.Tranlated("Chiết khấu", ""));
                    gct.SetParameterValue(0x19, modGeneral.Tranlated("Lập phiếu", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = gct;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    this.Cursor = Cursors.Default;
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public void PrintReportKH()
        {
            object obj2 = modGeneral.CreatKey("BC_DuLieuDanhMuc", 10, "");
            ReportModule.InitDuLieuDanhMuc(Conversions.ToString(obj2), this.VSList, 0, 1, "C");
            ReportModule.InitDuLieuDanhMuc(Conversions.ToString(obj2), this.VSListNV, 0, 1, "E");
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            DataTable dataTable = this.objXK.GetDataPrintHoaDon(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboDonVi.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), LVYModule.Date2Char(this.TxtTuNgay.Text), LVYModule.Date2Char(this.TxtDenNgay.Text), Conversions.ToString(obj2), this.pLoaiBC);
            if (dataTable.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                Rpt_BangKeHoaDonBanHangKH gkh = new Rpt_BangKeHoaDonBanHangKH();
                try
                {
                    gkh.SetDataSource(dataTable);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        gkh.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        gkh.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    gkh.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    gkh.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    gkh.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    gkh.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    gkh.SetParameterValue(5, modGeneral.Tranlated("BẢNG K\x00ca H\x00d3A ĐƠN B\x00c1N H\x00c0NG", ""));
                    gkh.SetParameterValue(6, modGeneral.Tranlated("Từ ng\x00e0y", "") + " : " + this.TxtTuNgay.Text);
                    gkh.SetParameterValue(7, modGeneral.Tranlated("Đến ng\x00e0y", "") + " : " + this.TxtDenNgay.Text);
                    gkh.SetParameterValue(8, modGeneral.Tranlated("Số chứng từ", ""));
                    gkh.SetParameterValue(9, modGeneral.Tranlated("Ng\x00e0y", ""));
                    gkh.SetParameterValue(10, modGeneral.Tranlated("Nh\x00e2n vi\x00ean", ""));
                    gkh.SetParameterValue(11, modGeneral.Tranlated("Tiền h\x00e0ng", ""));
                    gkh.SetParameterValue(12, modGeneral.Tranlated("Chiết khấu", ""));
                    gkh.SetParameterValue(13, modGeneral.Tranlated("Tiền thuế", ""));
                    gkh.SetParameterValue(14, modGeneral.Tranlated("Tổng thanh to\x00e1n", ""));
                    gkh.SetParameterValue(15, modGeneral.Tranlated("STT", ""));
                    gkh.SetParameterValue(0x10, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", ""));
                    gkh.SetParameterValue(0x11, modGeneral.Tranlated("Tổng", ""));
                    gkh.SetParameterValue(0x12, modGeneral.Tranlated("Lập biểu", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = gkh;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.WaitCursor;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public void PrintReportKHCT()
        {
            this.Cursor = Cursors.WaitCursor;
            object obj2 = modGeneral.CreatKey("BC_DuLieuDanhMuc", 10, "");
            ReportModule.InitDuLieuDanhMuc(Conversions.ToString(obj2), this.VSList, 0, 1, "C");
            ReportModule.InitDuLieuDanhMuc(Conversions.ToString(obj2), this.VSListNV, 0, 1, "E");
            DataTable dataTable = this.objXK.GetDataPrintHoaDon(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboDonVi.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), LVYModule.Date2Char(this.TxtTuNgay.Text), LVYModule.Date2Char(this.TxtDenNgay.Text), Conversions.ToString(obj2), this.pLoaiBC);
            if (dataTable.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                Rpt_BangKeHoaDonBanHangKHCT gkhct = new Rpt_BangKeHoaDonBanHangKHCT();
                try
                {
                    gkhct.SetDataSource(dataTable);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        gkhct.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        gkhct.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    gkhct.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    gkhct.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    gkhct.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    gkhct.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    gkhct.SetParameterValue(5, modGeneral.Tranlated("BẢNG K\x00ca H\x00d3A ĐƠN B\x00c1N H\x00c0NG", ""));
                    gkhct.SetParameterValue(6, modGeneral.Tranlated("Từ ng\x00e0y", "") + " : " + this.TxtTuNgay.Text);
                    gkhct.SetParameterValue(7, modGeneral.Tranlated("Đến ng\x00e0y", "") + " : " + this.TxtDenNgay.Text);
                    gkhct.SetParameterValue(8, modGeneral.Tranlated("Số chứng từ", ""));
                    gkhct.SetParameterValue(9, modGeneral.Tranlated("Ng\x00e0y", ""));
                    gkhct.SetParameterValue(10, modGeneral.Tranlated("Nh\x00e2n vi\x00ean", ""));
                    gkhct.SetParameterValue(11, modGeneral.Tranlated("Tổng :", ""));
                    gkhct.SetParameterValue(12, modGeneral.Tranlated("Tổng chiết khấu", ""));
                    gkhct.SetParameterValue(13, modGeneral.Tranlated("Tổng tiền thuế", ""));
                    gkhct.SetParameterValue(14, modGeneral.Tranlated("Tổng thanh to\x00e1n", ""));
                    gkhct.SetParameterValue(15, modGeneral.Tranlated("STT", ""));
                    gkhct.SetParameterValue(0x10, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", ""));
                    gkhct.SetParameterValue(0x11, modGeneral.Tranlated("Th\x00e0nh tiền", ""));
                    gkhct.SetParameterValue(0x12, modGeneral.Tranlated("M\x00e3 h\x00e0ng", ""));
                    gkhct.SetParameterValue(0x13, modGeneral.Tranlated("T\x00ean h\x00e0ng", ""));
                    gkhct.SetParameterValue(20, modGeneral.Tranlated("ĐVT", ""));
                    gkhct.SetParameterValue(0x15, modGeneral.Tranlated("SL", ""));
                    gkhct.SetParameterValue(0x16, modGeneral.Tranlated("Đơn gi\x00e1", ""));
                    gkhct.SetParameterValue(0x17, modGeneral.Tranlated("Tiền thuế", ""));
                    gkhct.SetParameterValue(0x18, modGeneral.Tranlated("Chiết khấu", ""));
                    gkhct.SetParameterValue(0x19, modGeneral.Tranlated("Lập phiếu", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = gkhct;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    this.Cursor = Cursors.Default;
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public void PrintReportNV()
        {
            object obj2 = modGeneral.CreatKey("BC_DuLieuDanhMuc", 10, "");
            ReportModule.InitDuLieuDanhMuc(Conversions.ToString(obj2), this.VSList, 0, 1, "C");
            ReportModule.InitDuLieuDanhMuc(Conversions.ToString(obj2), this.VSListNV, 0, 1, "E");
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            DataTable dataTable = this.objXK.GetDataPrintHoaDon(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboDonVi.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), LVYModule.Date2Char(this.TxtTuNgay.Text), LVYModule.Date2Char(this.TxtDenNgay.Text), Conversions.ToString(obj2), this.pLoaiBC);
            if (dataTable.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                Rpt_BangKeHoaDonBanHangNV gnv = new Rpt_BangKeHoaDonBanHangNV();
                try
                {
                    gnv.SetDataSource(dataTable);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        gnv.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        gnv.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    gnv.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    gnv.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    gnv.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    gnv.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    gnv.SetParameterValue(5, modGeneral.Tranlated("BẢNG K\x00ca H\x00d3A ĐƠN B\x00c1N H\x00c0NG", ""));
                    gnv.SetParameterValue(6, modGeneral.Tranlated("Từ ng\x00e0y", "") + " : " + this.TxtTuNgay.Text);
                    gnv.SetParameterValue(7, modGeneral.Tranlated("Đến ng\x00e0y", "") + " : " + this.TxtDenNgay.Text);
                    gnv.SetParameterValue(8, modGeneral.Tranlated("Số chứng từ", ""));
                    gnv.SetParameterValue(9, modGeneral.Tranlated("Ng\x00e0y", ""));
                    gnv.SetParameterValue(10, modGeneral.Tranlated("Nh\x00e2n vi\x00ean", ""));
                    gnv.SetParameterValue(11, modGeneral.Tranlated("Tiền h\x00e0ng", ""));
                    gnv.SetParameterValue(12, modGeneral.Tranlated("Chiết khấu", ""));
                    gnv.SetParameterValue(13, modGeneral.Tranlated("Tiền thuế", ""));
                    gnv.SetParameterValue(14, modGeneral.Tranlated("Tổng thanh to\x00e1n", ""));
                    gnv.SetParameterValue(15, modGeneral.Tranlated("STT", ""));
                    gnv.SetParameterValue(0x10, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", ""));
                    gnv.SetParameterValue(0x11, modGeneral.Tranlated("Tổng", ""));
                    gnv.SetParameterValue(0x12, modGeneral.Tranlated("Lập biểu", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = gnv;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.WaitCursor;
                    }
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public void PrintReportNVCT()
        {
            object obj2 = modGeneral.CreatKey("BC_DuLieuDanhMuc", 10, "");
            ReportModule.InitDuLieuDanhMuc(Conversions.ToString(obj2), this.VSList, 0, 1, "C");
            ReportModule.InitDuLieuDanhMuc(Conversions.ToString(obj2), this.VSListNV, 0, 1, "E");
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            DataTable dataTable = this.objXK.GetDataPrintHoaDon(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboDonVi.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), LVYModule.Date2Char(this.TxtTuNgay.Text), LVYModule.Date2Char(this.TxtDenNgay.Text), Conversions.ToString(obj2), this.pLoaiBC);
            if (dataTable.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                Rpt_BangKeHoaDonBanHangNVCT gnvct = new Rpt_BangKeHoaDonBanHangNVCT();
                try
                {
                    gnvct.SetDataSource(dataTable);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        gnvct.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        gnvct.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    gnvct.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    gnvct.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    gnvct.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    gnvct.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    gnvct.SetParameterValue(5, modGeneral.Tranlated("BẢNG K\x00ca H\x00d3A ĐƠN B\x00c1N H\x00c0NG", ""));
                    gnvct.SetParameterValue(6, modGeneral.Tranlated("Từ ng\x00e0y", "") + " : " + this.TxtTuNgay.Text);
                    gnvct.SetParameterValue(7, modGeneral.Tranlated("Đến ng\x00e0y", "") + " : " + this.TxtDenNgay.Text);
                    gnvct.SetParameterValue(8, modGeneral.Tranlated("Số chứng từ", ""));
                    gnvct.SetParameterValue(9, modGeneral.Tranlated("Ng\x00e0y", ""));
                    gnvct.SetParameterValue(10, modGeneral.Tranlated("Kh\x00e1ch h\x00e0ng", ""));
                    gnvct.SetParameterValue(11, modGeneral.Tranlated("Tổng :", ""));
                    gnvct.SetParameterValue(12, modGeneral.Tranlated("Tổng chiết khấu", ""));
                    gnvct.SetParameterValue(13, modGeneral.Tranlated("Tổng tiền thuế", ""));
                    gnvct.SetParameterValue(14, modGeneral.Tranlated("Tổng thanh to\x00e1n", ""));
                    gnvct.SetParameterValue(15, modGeneral.Tranlated("STT", ""));
                    gnvct.SetParameterValue(0x10, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", ""));
                    gnvct.SetParameterValue(0x11, modGeneral.Tranlated("Th\x00e0nh tiền", ""));
                    gnvct.SetParameterValue(0x12, modGeneral.Tranlated("M\x00e3 h\x00e0ng", ""));
                    gnvct.SetParameterValue(0x13, modGeneral.Tranlated("T\x00ean h\x00e0ng", ""));
                    gnvct.SetParameterValue(20, modGeneral.Tranlated("ĐVT", ""));
                    gnvct.SetParameterValue(0x15, modGeneral.Tranlated("SL", ""));
                    gnvct.SetParameterValue(0x16, modGeneral.Tranlated("Đơn gi\x00e1", ""));
                    gnvct.SetParameterValue(0x17, modGeneral.Tranlated("Tiền thuế", ""));
                    gnvct.SetParameterValue(0x18, modGeneral.Tranlated("Chiết khấu", ""));
                    gnvct.SetParameterValue(0x19, modGeneral.Tranlated("Lập phiếu", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = gnvct;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    this.Cursor = Cursors.Default;
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public void SearchKhachHang(string field, string str)
        {
            string str2 = field + " LIKE '" + str + "%'";
            this.cFrmData.RowFilter = str2;
            if (this.VSList.Rows.Count != 1)
            {
                this.VSList.Select(1, 0, 1, this.VSList.Cols.Count - 1);
            }
        }

        public void SearchNhanVien(string field, string str)
        {
            string str2 = field + " LIKE '" + str + "%'";
            this.pData.RowFilter = str2;
            if (this.VSList.Rows.Count != 1)
            {
                this.VSList.Select(1, 0, 1, this.VSList.Cols.Count - 1);
            }
        }

        private void TxtMaKH_TextChanged(object sender, EventArgs e)
        {
            this.SearchKhachHang("Ma", this.TxtMaKH.Text);
        }

        private void TxtMaNV_TextChanged(object sender, EventArgs e)
        {
            this.SearchNhanVien("Ma", this.TxtMaNV.Text);
        }

        private void TxtTenKH_TextChanged(object sender, EventArgs e)
        {
            this.SearchKhachHang("TenViet", this.TxtTenKH.Text);
        }

        private void TxtTenNV_TextChanged(object sender, EventArgs e)
        {
            this.SearchNhanVien("TenViet", this.TxtTenNV.Text);
        }

        private void TxtTuNgay_LostFocus(object sender, EventArgs e)
        {
            if (LVYModule.sRight(this.TxtTuNgay.Text, 7) != LVYModule.sRight(this.TxtDenNgay.Text, 7))
            {
                this.TxtDenNgay.Text = DateTime.DaysInMonth(Conversions.ToInteger(LVYModule.sRight(this.TxtTuNgay.Text, 4)), Conversions.ToInteger(LVYModule.sMid(this.TxtTuNgay.Text, 4, 2))).ToString() + "/" + LVYModule.sRight(this.TxtTuNgay.Text, 7);
            }
        }

        private void VSList_BeforeEdit(object sender, RowColEventArgs e)
        {
            if (modGeneral.H_GIOIHANDULIEU)
            {
                e.Cancel = true;
            }
            else if (e.Col != 1)
            {
                e.Cancel = true;
            }
        }

        private void VSListNV_BeforeEdit(object sender, RowColEventArgs e)
        {
            if (modGeneral.H_GIOIHANDULIEU)
            {
                e.Cancel = true;
            }
            else if (e.Col != 1)
            {
                e.Cancel = true;
            }
        }

        internal virtual C1DockingTab C1DockingTab1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTab1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTab1 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage1 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage2 = value;
            }
        }

        internal virtual ComboBox CboDonVi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboDonVi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboDonVi = value;
            }
        }

        internal virtual ComboBox CboNhomTheo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboNhomTheo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboNhomTheo = value;
            }
        }

        internal virtual Button CmdCancel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCancel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdCancel_Click);
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click -= handler;
                }
                this._CmdCancel = value;
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click += handler;
                }
            }
        }

        internal virtual Button CmdOK
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdOK;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdOK_Click);
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click -= handler;
                }
                this._CmdOK = value;
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click += handler;
                }
            }
        }

        internal virtual GroupBox GroupBox1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox1 = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Label Label6
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label6;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label6 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual Panel Panel2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel2 = value;
            }
        }

        internal virtual Panel Panel3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel3 = value;
            }
        }

        internal virtual RadioButton RbChiTiet
        {
            [DebuggerNonUserCode]
            get
            {
                return this._RbChiTiet;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._RbChiTiet = value;
            }
        }

        internal virtual RadioButton RbTongHop
        {
            [DebuggerNonUserCode]
            get
            {
                return this._RbTongHop;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._RbTongHop = value;
            }
        }

        internal virtual DateTimePicker TxtDenNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDenNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDenNgay = value;
            }
        }

        internal virtual TextBox TxtMaKH
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtMaKH;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtMaKH_TextChanged);
                if (this._TxtMaKH != null)
                {
                    this._TxtMaKH.TextChanged -= handler;
                }
                this._TxtMaKH = value;
                if (this._TxtMaKH != null)
                {
                    this._TxtMaKH.TextChanged += handler;
                }
            }
        }

        internal virtual TextBox TxtMaNV
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtMaNV;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtMaNV_TextChanged);
                if (this._TxtMaNV != null)
                {
                    this._TxtMaNV.TextChanged -= handler;
                }
                this._TxtMaNV = value;
                if (this._TxtMaNV != null)
                {
                    this._TxtMaNV.TextChanged += handler;
                }
            }
        }

        internal virtual TextBox TxtTenKH
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTenKH;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtTenKH_TextChanged);
                if (this._TxtTenKH != null)
                {
                    this._TxtTenKH.TextChanged -= handler;
                }
                this._TxtTenKH = value;
                if (this._TxtTenKH != null)
                {
                    this._TxtTenKH.TextChanged += handler;
                }
            }
        }

        internal virtual TextBox TxtTenNV
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTenNV;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtTenNV_TextChanged);
                if (this._TxtTenNV != null)
                {
                    this._TxtTenNV.TextChanged -= handler;
                }
                this._TxtTenNV = value;
                if (this._TxtTenNV != null)
                {
                    this._TxtTenNV.TextChanged += handler;
                }
            }
        }

        internal virtual DateTimePicker TxtTuNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTuNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtTuNgay_LostFocus);
                if (this._TxtTuNgay != null)
                {
                    this._TxtTuNgay.LostFocus -= handler;
                }
                this._TxtTuNgay = value;
                if (this._TxtTuNgay != null)
                {
                    this._TxtTuNgay.LostFocus += handler;
                }
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSList
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSList;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._VSList = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSListNV
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSListNV;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._VSListNV = value;
            }
        }
    }
}

